import request from '@/utils/request'


export function addMaintenancePlan(data){
  return request({
    url: '/maintenance/maintenancedb/addMaintenancePlan',
    method: 'post',
    data: data
  })
}

export function planList(formDataOn){
  return request({
    url: '/maintenance/maintenancedb/planList',
    method: 'get',
    params: formDataOn
  })
}
// 查询设备
export function getMaintenanceSchedules(){
  return request({
    url: '/maintenance/maintenancedb/getMaintenanceSchedules',
    method: 'get',
  })
}
// 查询
export function list(){
  return request({
    url: '/maintenance/maintenancedb/list',
    method: 'get'
  })
}
export function getUser(){

  return request({
    url: '/inspection/db/getUser',
    method: 'get'
  })
}

// 查询定时任务调度详细
export function getPlan(formDataOn) {
  return request({
    url: '/checkplan/plan/list',
    method: 'get',
    params: formDataOn
  })
}
// 查询定时任务调度详细
export function getInspectionRecord() {
  return request({
    url: '/inspection/db/getInspectionRecord',
    method: 'get',
  })
}


// 查询定时任务调度详细
export function getFaultDeclaration() {
  return request({
    url: '/inspection/db/getFaultDeclaration',
    method: 'get',
  })
}


// 查询设备
export function deviceList(data){

  return request({
    url: '/inspection/db/deviceList',
    method: 'get',
    params: data
  })
}


// 查询设备
export function getUsers(){

  return request({
    url: '/inspection/db/getUsers',
    method: 'get',
  })
}
// 查询设备
export function getDepts(){

  return request({
    url: '/inspection/db/getDepts',
    method: 'get',
  })
}

// 故障申报
export function faultDeclaration(data){

  return request({
    url: '/inspection/db/faultDeclaration',
    method: 'post',
    data: data
  })
}

// 保存修改
export function inspectionRecordUpload(data){

  return request({
    url: '/inspection/db/inspectionRecordUpload',
    method: 'post',
    data: data
  })
}

// 保存修改
export function saveEdit(data){

  return request({
    url: '/inspection/db/saveEdit',
    method: 'post',
    data: data
  })
}
// 保存修改
export function addCheckingPlan(data){
  return request({
    url: '/checkplan/plan/schedule',
    method: 'post',
    data: data
  })
}


// 恢复默认
export function restore(period){
  return request({
    url: '/inspection/db/restore/'+ period,
    method: 'get',
  })
}

// 新增部门
export function addDept(data) {
  return request({
    url: '/system/dept',
    method: 'post',
    data: data
  })
}


// 查询定时任务调度详细
export function getRegionList() {
  return request({
    url: '/management/region/regionList',
    method: 'get'
  })
}

// 查询统计
export function listStatic(formDataOn) {
  return request({
    url: '/maintenance/maintenancedb/liststatus',
    method: 'get',
    params: formDataOn
  })
}
// 查询统计
export function listMcount() {
  return request({
    url: '/maintenance/maintenancedb/count',
    method: 'get',
  })
}

// 查询统计
export function listByrs() {
  return request({
    url: '/maintenance/maintenancedb/getbyrs',
    method: 'get',
  })
}

